import { provide, inject } from 'vue'
import { TypeBoxItem } from "../type";
import _ from "lodash"
class Store {
  constructor() {

  }
  provide(params: { uid: string }) {
    const _focusState: TypeBoxItem = {
      uid: params.uid,
      name: "focus-box",
      cacheWidgetId: "",
    }
    provide('focus-box-store', _focusState)
    return {
      state: _focusState,
    }
  }
  inject() {
    const _focusState: TypeBoxItem = inject('focus-box-store', {
      uid: "",
      name: "focus-box",
      cacheWidgetId: "",
    })
    return {
      state: _focusState,
    }
  }
}
export default new Store()